xemnstored: Fix xenstored abort when connection dropped.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 1 May 2008 09:00:00 +0000 (10:00 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 1 May 2008 09:00:00 +0000 (10:00 +0100)
commit84aaf4530b7d495668fb2c69fdd6f5c28533c1ac
treecb246156ea962092bef37df767ef8fbaeeba043f
parenta2f23ae851a744beb582ab4f11d654516fde1e78
xemnstored: Fix xenstored abort when connection dropped.

If a connection is dropped with pending input and output data then the
connection will be dereferenced by both handle_input and handle_output
resulting in a double free when the main loop dereferences the
connection.

Fix this issue by taking/releasing a reference over the calls to
handle_input and handle_output separately and checking the result of
talloc_free to see if the connection went away.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
tools/xenstore/xenstored_core.c